# name : logistic regression via proc genmod dist=poisson for risk ratio RR
# key : logistic.reg.genmod.poisson.riskratio
# contributor: Shuguang Sun
# --
proc genmod data=${1:dtin};
  class ${2:trt01pn}${3:(reference="P")};
  model ${4:count} = $2 ${5:covs} / offset=${6:logpy} dist=poisson link=log;
  ** estimate 'RR' $2 -1 1 / exp;
  lsmeans $2 / pdiff cl ilink exp;
run;
